//
//  FDSPGKJLClassInfoView.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/4/24.
//  Copyright © 2019 SanYi. All rights reserved.
//

#import "FDSPGKJLClassInfoView.h"

@implementation FDSPGKJLClassInfoView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)init{
    if ([super init]) {
        [self initSubView];
        [self layout];
    }
    return self;
}
- (void)initSubView{
    [self addSubview:self.nameLabel];
    [self addSubview:self.detailLabel];
    [self addSubview:self.lineView];
}
- (void)layout{
    [_detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX).offset(50);
        make.width.equalTo(@250);
        make.height.equalTo(@30);
        make.centerY.equalTo(self.mas_centerY);
    }];
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@0);
        make.right.equalTo(self->_detailLabel.mas_left).offset(-10);
        make.height.equalTo(@30);
        make.centerY.equalTo(self.mas_centerY);
    }];
    [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self->_detailLabel.mas_left);
        make.right.equalTo(self->_detailLabel.mas_right).offset(-10);
        make.height.equalTo(@1);
        make.bottom.equalTo(self.mas_bottom);
    }];
}
- (UILabel *)nameLabel{
    if (!_nameLabel) {
        UILabel *label = [[UILabel alloc]init];
        label.text = @"name:";
        label.textColor = TITLECOLOR;
        label.textAlignment = 2;
        label.font = [UIFont systemFontOfSize:14];
        _nameLabel = label;
    }
    return _nameLabel;
}
- (UILabel *)detailLabel{
    if (!_detailLabel) {
        UILabel *label = [[UILabel alloc]init];
        label.text = @"班级信息";
        label.textColor = TITLECOLOR;
        label.textAlignment = 0;
        label.font = [UIFont systemFontOfSize:13];
        _detailLabel = label;
    }
    return _detailLabel;
}
- (UIView *)lineView{
    if (!_lineView) {
        UIView *view = [[UIView alloc]init];
        view.backgroundColor = LINCOLOR;
        _lineView = view;
    }
    return _lineView;
}
@end
